/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Arrays;
import java.util.Random;

/**
 * <p>Project: jse2204 - C5
 * <p>Powered by webrx On 2022-09-07 11:31:01
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class C5 {
    /*类的入口方法，代表本类可以直接执行*/
    public static void main(String[] args) {

        m1();

        //非静态的方法，可以实例化后通过变量调用
        C5 c = new C5();
        System.out.println(Arrays.toString(c.m4()));
        int nnn = c.m2(6);
        System.out.println(nnn);

        int t = 16;
        c.m3(t);


        //System.out.println(c.m2(3));
    }

    public static void m1() {
        System.out.println("m1()");
    }

    public int m2(int i) {
        return i * i;
    }

    public void m3(int n) {
        System.out.println(n * n);
    }

    /*方法的参数个数不知道有几个，返回多个元素*/

    public int[] m4() {
        int[] tm = new int[10];
        Random rand = new Random();
        for (int i = 0; i < 10; i++) {
            tm[i] = rand.nextInt(1,101);
        }
        return tm;
    }


}
